@()(implicit flash:Flash, session: Session)
@background.main("修改密码") {


    <div class="col-sm-12">
        <section class="main-col" style="margin: 150px;">
            <div class="register">
                <h2 class="page-heading" style="font-size: 25px;">修改密码</h2>
                <form id="form" class="registration-form form-horizontal" accept-charset="UTF-8"
                action="@routes.AdminController.changePassword()" autocomplete="off" method="post">
                    <div align="center">
                        <span class="error" style="line-height: 35px;">@flash.get("info")
                        </span>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-sm-4">账号:</label>
                        <div class="col-sm-4">
                            <div class="input-group">
                                <span class="input-group-addon"><em
                                class="fa fa-user icon2x"></em></span>
                                <input id="loginEmail" name="account" placeholder="请输入账号" autofocus="autofocus"
                                type="text" class="form-control" required value="@session.get("admin")" readonly="readonly"/>
                            </div>
                        </div>

                    </div>

                    <div class="form-group">
                        <label class="control-label col-sm-4">旧密码:</label>
                        <div class="col-sm-4">
                            <div class="input-group">
                                <span class="input-group-addon"><em
                                class="fa fa-key icon2x"></em></span>
                                <input id="password" name="password" placeholder="请输入旧密码" type="password" autofocus="autofocus" class="form-control" maxlength="30"/>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-sm-4">新密码:</label>
                        <div class="col-sm-4">
                            <div class="input-group">
                                <span class="input-group-addon"><em
                                class="fa fa-key icon2x"></em></span>
                                <input id="newPassword" name="newPassword" placeholder="请输入新密码" type="password" class="form-control" maxlength="30"/>
                            </div>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="control-label col-sm-4">确认密码:</label>
                        <div class="col-sm-4">
                            <div class="input-group">
                                <span class="input-group-addon"><em
                                class="fa fa-key icon2x"></em></span>
                                <input id="newPasswordAgain" name="newPasswordAgain" placeholder="再次确认新密码" type="password" class="form-control" maxlength="30"/>
                            </div>
                        </div>
                    </div>

                    <div class="actions col-sm-offset-4 col-sm-4">
                        <input type="submit" id="passwordSubmit" value="修改密码"
                        class="btn btn-primary btn-lg">
                    </div>
                </form>

            </div>
        </section>
    </div>


    <script>
            $(function () {
                $('#form').bootstrapValidator({
                    feedbackIcons: {
                        valid: 'glyphicon glyphicon-ok',
                        invalid: 'glyphicon glyphicon-remove',
                        validating: 'glyphicon glyphicon-refresh'
                    },
                    fields: {
                        password: {
                            validators: {
                                notEmpty: {
                                    message: "请输入旧密码！"
                                }
                            }
                        },
                        newPassword: {
                            validators: {
                                notEmpty: {
                                    message: "请输入新密码！"
                                }
                            }
                        },
                        newPasswordAgain: {
                            validators: {
                                notEmpty: {
                                    message: "请确认新密码！"
                                },
                                identical: {
                                    field: 'newPassword',
                                    message: '与您输入的新密码不一致!'
                                }
                            }
                        }
                    }
                });
            })

    </script>
}